home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Apple Guide / Engineering / APISample / APISampleMPW / Resources / UApp.r < prev    next >
Encoding:
Text File  |  1994-03-14  |  9.0 KB  |  355 lines  |  [TEXT/MPS ]

  1. // Copyright ©1994 Apple Computer, Inc.
  2. // Author: John Powers
  3. // Date:   13-Mar-94
  4.  
  5. // UApp.r
  6. // Resources for UApp.
  7.  
  8. #define SystemSevenOrLater    true
  9.  
  10.         // Standard types
  11.  
  12. #ifndef __TYPES.R__ 
  13.     #include "Types.r"
  14. #endif
  15.  
  16. #ifndef __SYSTYPES.R__
  17.     #include "SysTypes.r"        // needed for version resource
  18. #endif
  19.  
  20.         // Our application resource constants
  21.  
  22. #include "::UAppShared.h"
  23.  
  24.         // Include our app's BNDL.
  25.  
  26. include "UApp.rsrc";
  27.  
  28.         // Include our app's dialogs and alerts.
  29.  
  30. include "AboutDLOG.rsrc";
  31. include "AutoStartALRT.rsrc";
  32. include "DBInfoDLOG.rsrc";
  33. include "AlertIfError.rsrc";
  34. include "OpenDLOG.rsrc";
  35.  
  36.         // Include the PICTs used by our app.
  37.  
  38. include "Picts.rsrc";
  39.  
  40.         // Include Apple event and Finder balloon resources.
  41.  
  42. include "aete.rsrc";
  43. include "hfdr.rsrc";
  44.  
  45.         // ResEdit Template
  46.  
  47. type 'TMPL' {
  48.     array fieldArray {
  49.         pstring;
  50.         literal longint;
  51.     };
  52. };
  53.  
  54. //--------------------------------------------------------------------------------
  55. resource 'MBAR' (rMenuBar, preload) {
  56.     { mApple, mFile, mEdit };
  57. };
  58.  
  59. resource 'MBAR' (rMenuBarMo, preload) {
  60.     { mApple, mFile, mEdit, mMoGuide, mWindow };
  61. };
  62.  
  63.  
  64. resource 'MENU' (mApple, preload) {
  65.     mApple,
  66.     textMenuProc,
  67.     0b1111111111111111111111111111101,    // Disable dashed line
  68.     enabled,
  69.     apple,
  70.     {
  71.         "About "kProgramName"…", noIcon, nokey, nomark, plain;
  72.         "-", noIcon, nokey, nomark, plain
  73.     }
  74. };
  75.  
  76. resource 'MENU' (mFile, preload) {
  77.     mFile,
  78.     textMenuProc,
  79.     0b0000000000000000000000000000000,
  80.     enabled,
  81.     "File",
  82.     {
  83.         "Open Database…", noIcon, "O", nomark, plain;
  84.         "Close Database", noIcon, "W", nomark, plain;
  85.         "Get Info...", noIcon, "I", nomark, plain;
  86.         "-", noIcon, nokey, nomark, plain;
  87.         "Quit", noIcon, "Q", nomark, plain;
  88.     }
  89. };
  90.  
  91. resource 'MENU' (mEdit, preload) {
  92.     mEdit,
  93.     textMenuProc,
  94.     0b0000000000000000000000000000000,
  95.     enabled,
  96.     "Edit",
  97.     {
  98.         "Undo", noIcon, "Z", nomark, plain;
  99.         "-", noIcon, nokey, nomark, plain;
  100.         "Cut", noIcon, "X", nomark, plain;
  101.         "Copy", noIcon, "C", nomark, plain;
  102.         "Paste", noIcon, "V", nomark, plain;
  103.         "Clear", noIcon, nokey, nomark, plain;
  104.         "-", noIcon, nokey, nomark, plain;
  105.         "Show Clipboard", noIcon, nokey, nomark, plain;
  106.     }
  107. };
  108.  
  109. resource 'MENU' (mMoGuide, preload) {
  110.     mMoGuide,
  111.     textMenuProc,
  112.     0b0000000000000000000000000000000,
  113.     enabled,
  114.     "MoGuide",
  115.     {
  116.         "Start Guide", noIcon, nokey, nomark, plain;
  117.         "Quit Guide", noIcon, nokey, nomark, plain;
  118.         "Open Default", noIcon, nokey, nomark, plain;
  119.         "Close Database", noIcon, nokey, nomark, plain;
  120.         "-", noIcon, nokey, nomark, plain;
  121.         "Add Databases", noIcon, nokey, nomark, plain;
  122.     }
  123. };
  124.  
  125. resource 'MENU' (mWindow, preload) {
  126.     mWindow,
  127.     textMenuProc,
  128.     0b0000000000000000000000000000000,
  129.     enabled,
  130.     "Window",
  131.     {
  132.         "Art Window", noIcon, nokey, nomark, plain;
  133.         "Reset", noIcon, nokey, nomark, plain;
  134.         "Shuffle", noIcon, nokey, nomark, plain;
  135.         "-", noIcon, nokey, nomark, plain;
  136.         "Feedback Window", noIcon, nokey, nomark, plain;
  137.         "Context true", noIcon, nokey, nomark, plain;
  138.         "Context beep", noIcon, nokey, nomark, plain;
  139.     }
  140. };
  141.  
  142. //--------------------------------------------------------------------------------
  143. resource 'vers' (1, kProgramName, purgeable) {
  144.     kVersionBytes,
  145.     kVersionNumber,
  146.     kVersionNumber"  "kVersionDate " "kCopyright
  147. };
  148.  
  149. resource 'vers' (2, kProgramName, purgeable)
  150. {
  151.     0x01, 0x00, release, 0x00, verUS,
  152.     "1.0",
  153.     "(by John Powers)"
  154. };
  155.  
  156. //--------------------------------------------------------------------------------
  157. type kCreator as 'STR ';
  158.  
  159. resource kCreator (0) {                // Creator (or Signature)   
  160.     kProgramName " " kVersionNumber " " kVersionDate " " kCopyright;
  161. };
  162.  
  163. //--------------------------------------------------------------------------------
  164. resource 'STR#' (kUserStrId, "User strings", purgeable) {
  165.     {
  166.         "This application requires System 7."
  167.     };
  168. };
  169.  
  170. //--------------------------------------------------------------------------------
  171. resource 'STR#' (kFeedbackStrId, "Feedback strings", purgeable) {
  172.     {
  173.         "Context: ",
  174.         "Coach: ",
  175.         "Event: ",
  176.         "Guide: "
  177.     };
  178. };
  179.  
  180. //--------------------------------------------------------------------------------
  181. resource 'STR#' (kFrontWindowStrId, "Front window strings", purgeable) {
  182.     {
  183.         "",            // Apple Guide is not running.
  184.         "zzz…",        // Apple Guide is sleeping.
  185.         "accw",        // Apple Guide access window is showing.
  186.         "prew"        // Apple Guide presentation window is showing.
  187.     };
  188. };
  189.  
  190. //--------------------------------------------------------------------------------
  191. resource 'SIZE' (-1) {
  192.     reserved,                    // reserved
  193.     acceptSuspendResumeEvents,    // or ignoreSuspendResumeEvents
  194.     reserved,                    // reserved
  195.     canBackground,                // or cannotBackground
  196.     doesActivateOnFGSwitch,        // or needsActivateOnFGSwitch
  197.     backgroundAndForeground,    // or onlyBackground
  198.     dontGetFrontClicks,            // or getFrontClicks
  199.     ignoreAppDiedEvents,        // or acceptAppDiedEvents (for debuggers)
  200.     is32BitCompatible,            // or not32BitCompatible
  201.     isHighLevelEventAware,        // or notHighLevelEventAware
  202.     localAndRemoteHLEvents,        // or onlyLocalHLEvents
  203.     notStationeryAware,            // or isStationeryAware
  204.     dontUseTextEditServices,    // or useTextEditServices 
  205.     reserved,
  206.     reserved,
  207.     reserved,
  208.     300 * 1024,        // preferred
  209.     200 * 1024        // minimum
  210. };
  211.  
  212. //--------------------------------------------------------------------------------
  213. // A button in the Feedback window.
  214. // Starts up a guide database.
  215. resource 'CNTL' (kAssistantCntlID, "Assistant") {
  216.     {0, 0, 14, 72},
  217.     0,                        // value
  218.     invisible,                // or visible
  219.     1,                        // max
  220.     0,                        // min
  221.     pushButProcUseWFont,    // procID (pushbutton with window font)
  222.     0,                        // refCon
  223.     "Assistant"                // title - the file name is defined in kResAutoStart.
  224. };
  225.  
  226. //--------------------------------------------------------------------------------
  227. // The window and art objects are linked together by sharing the same id.
  228. resource 'WIND' (kArt1WindResID, "Art", purgeable) {
  229.     {0, 0, 180, 440},
  230.     noGrowDocProc,
  231.     invisible,
  232.     goAway,
  233.     0x0,
  234.     "Art",
  235.     centerMainScreen
  236. };
  237.  
  238. resource 'WIND' (kClipboardWinResID, "Clipboard", purgeable) {
  239.     {70, 50, 170, 391},        // Same width as PreWin
  240.     documentProc,
  241.     invisible,
  242.     goAway,
  243.     0x0,
  244.     "Clipboard",
  245.     noAutoCenter
  246. };
  247.  
  248. resource 'WIND' (kFeedbackWinResID, "Feedback", purgeable) {
  249.     {45, 25, 120, 175},
  250.     documentProc,
  251.     invisible,
  252.     goAway,
  253.     0x0,
  254.     "Feedback",
  255.     noAutoCenter
  256. };
  257.  
  258. // kResArtObjects
  259. // Defines all the art objects in the window.
  260. // The id of the kResArtObjects resource matches the id of its window.
  261. //
  262. // Order the objects from front to back.
  263.  
  264. // Glenn and Pat want to go to Josh and Kay's side.
  265. // Josh and Kay want to go to Glenn and Pat's side.
  266. // Bill and Eileen are in the middle, but can't be moved
  267. // (they can be very stubborn).  You can get them
  268. // to move with a "shuffle".  A shuffle randomly
  269. // reassigns the pieces in their current locations.
  270. //
  271. //--------------------------------------------------------------------------------
  272. type kResArtObjects {
  273.     integer = $$Countof(objects);
  274.     array objects {
  275.         integer;        // PICT ID
  276.         integer;        // Vertical location
  277.         integer;        // Horizonal location
  278.         integer;        // layer (0=furthest back)
  279.         integer;        // isMoveable (0=cannot move)
  280.         integer;        // guide database Sequence ID
  281.         cstring[32];    // name (31 chars + terminator)
  282.     };
  283. };
  284.  
  285. resource 'TMPL' (9001, kResArtObjectsLabel, purgeable) {
  286.     {
  287.         "No.Objects",    'OCNT';
  288.         "*****",        'LSTC';
  289.         "PICT ID",            'DWRD';
  290.         "Vert location",    'DWRD';
  291.         "Horiz location",    'DWRD';
  292.         "Layer",            'DWRD';
  293.         "1=IsMoveable",        'DWRD';
  294.         "Guide sequence id",    'DWRD';
  295.         "Name",                'C020';    // 0x0020 bytes long
  296.         "*****",        'LSTE';
  297.         "",             'AWRD';
  298.     }
  299. };
  300.  
  301. resource kResArtObjects (kArt1WindResID, "Art Objects", purgeable) {
  302.     {
  303.         //    PICT,    LocV,    LocH,    layer, move, sequenceID, name
  304.  
  305.             1000,      30,        60,        1,        1,        3013,    "Glenn";
  306.             1004,    30,        180,    1,        0,        3014,    "Bill";
  307.             1008,    30,        300,    1,        1,        3015,    "Josh";
  308.             1012,    100,    60,        1,        1,        3016,    "Pat";
  309.             1016,    100,    180,    1,        0,        3017,    "Eileen";
  310.             1020,    100,    300,    1,        1,        3018,    "Kay";
  311.     };
  312. };
  313.  
  314. //--------------------------------------------------------------------------------
  315. type kResAutoStart {
  316.     integer none=0, auto=1, self=2;        // Auto-start?
  317.     integer stay=0, quit=1;                // Quit when guide database closes?
  318.     integer;    // guide file type (optional)
  319.     integer;    // sequence id (optional, requires type or name)
  320.     pstring;    // guide database file name (optional, overrides file type)
  321.     align word;
  322. };
  323.  
  324. resource 'TMPL' (9003, kResAutoStartLabel, purgeable) {
  325.     {
  326.         "0=none, 1=auto, 2=self",    'DWRD';
  327.         "0=stay, 1=quit",            'DWRD';
  328.         "Guide file type",            'DWRD';
  329.         "Sequence id",                'DWRD';
  330.         "Guide file name",            'PSTR';
  331.         "",                         'AWRD';
  332.     }
  333. };
  334.  
  335. // AutoStart options in descending priority:
  336. //
  337. //    1. Auto-start self (guide database is contained within this application.)
  338. //    2. Auto-start with guide file name
  339. //    3. Auto-start with guide file name with sequence id
  340. //    4. Auto-start with guide file type
  341. //    5. Auto-start with guide file type with sequence id
  342. //
  343. // In the following example, we don't do an auto-start,
  344. // but we do specify the preset guide database.
  345. //
  346. resource kResAutoStart (130, "AutoStart", purgeable) {
  347.         none,                // none, auto, self
  348.         stay,                // stay or quit when guide file closes.
  349.         0,                    // type = kAHDBTypeHelp (0 for none).
  350.         0,                    // sequence id (0 for none)
  351.         "Assistant"            // File name (overrides file type)
  352. };
  353.  
  354.  
  355.